USE [SONALIKA_BGK_UPDATED]
GO

/****** Object:  Table [dbo].[INVOICE]    Script Date: 07-Jun-14 11:53:11 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[INVOICE](
	[INVOICE_ID] [int] IDENTITY(1,1) NOT NULL,
	[INVOICE_NO] [varchar](50) NOT NULL,
	[INVOICE_DATE] [datetime] NOT NULL,
	[INVOICE_DISCOUNT] [decimal](18, 2) NOT NULL,
	[INVOICE_GRANDTOTAL] [decimal](18, 2) NOT NULL,
	[EXPENDITURE_ON_SUBTOAL] [decimal](18, 2) NULL,
	[PURCHASE_TYPE] [int] NOT NULL,
 CONSTRAINT [PK_INVOICE] PRIMARY KEY CLUSTERED 
(
	[INVOICE_ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[INVOICE]  WITH CHECK ADD  CONSTRAINT [FK_INVOICE_MASTER] FOREIGN KEY([PURCHASE_TYPE])
REFERENCES [dbo].[MASTER] ([MASTER_ID])
GO

ALTER TABLE [dbo].[INVOICE] CHECK CONSTRAINT [FK_INVOICE_MASTER]
GO

